#ifndef TABLE_H
#define TABLE_H

#include <string>
#include <vector>

#include <iostream>
#include <iomanip>

#include "IntCell.h"
#include "VarcharCell.h"
#include "NullCell.h"
#include "Helper.h"
#include "Row.h"

using std::cout;

using std::string;
using std::vector;

class Table
{
public:
	Table();
	~Table();
	string getName();
	void setName(const string &p_name);
	vector<string> getColumns();
	//return a vector contains all columns of the table

	int getColumnIndex(const string &column);
	//return index of the column name in the vector columns
	//param the name of the column. no case-sensitive

	void addColumn(const string &column);
	
	//param is column name
	//add new column to the table

	void addColumn(const string &column, int type);

	vector<int> getTypes();
	//return a vector of integer
	//that represents the types of each column in the table
	void setTypes(vector<int> newTypes);
	void addType(int type);
	vector<Row *> getRows();
	Row* getRow(int index);
	//add new row to the table
	void addRow(Row* row);
	void setRows(vector<Row *> newRows);
	void setRow(int oldPos, int newPos);
	void setRow(int pos, Row* row);
	void removeRows(int index);
	
	void display();
	//display columns header and each row of the table

private:
	string name;
	vector<string> columns;
	vector<int> types;
	vector<Row *> rows;
	Helper* helper;	//contains methods for malnipulate string

};

#endif
